home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / mrcry204.zip / LADDERS.EKA < prev    next >
Text File  |  1991-03-04  |  899b  |  31 lines

  1. ; This demonstrates solving a system of nonlinear equations,
  2. ; and initializing the iterative solver.
  3. ; The equations are from a geometrical problems involving ladders.
  4.  
  5. ; Problem: You have two ladders, one 35 feet long, the other 45 feet
  6. ; long.  You need to arrange them in an alley between two skyscrapers
  7. ; so that they cross 10 feet above the ground.  How wide should the
  8. ; alley be?
  9.  
  10. ; Let:
  11. ;    x = width of the alley
  12. ;    a = height of the 45-foot ladder
  13. ;    b = height of the 35-foot ladder
  14. ;    P = point on ground below where ladders cross
  15. ;    y = distance along the ground between P and 35-foot ladder
  16. ;    z = distance along the ground between P and 45-foot ladder
  17.  
  18. { These are the equations.}
  19.  x^2 + a^2 = 45^2
  20.  x^2 + b^2 = 35^2
  21.  y / 10 = x / b
  22.  z / 10 = x / a
  23.  y + z = x
  24.  
  25. { These are the initializations.}
  26.  x := 20
  27.  y := 20
  28.  a := 20
  29.  b := 20
  30.  z := 20
  31.